﻿<!--#include file="../../lib/base.asp"-->
<!--#include file="../../theme/admin/config.asp"-->
<!--#include file="../../lib/cmd.asp"-->
<%
''' SDCMS 蜘蛛来访插件
''' ==================================================================
''' 版权所有 http://www.sdcms.cn
''' ------------------------------------------------------------------
''' 这不是一个自由软件！您只能在不用于商业目的的前提下对程序代码进行修改和使用；
''' 未经授权不允许对程序代码以任何形式任何目的的再发布。
''' ==================================================================
''' 插件编写: IT平民
''' 修改：IT平民 in 2014.07

	'注释：插件是否安装
	is_plug_install "sdcms.plug.spider"
	
	'注释：管理权限检查
	is_plug_login
	
	'注释：定义插件模板路径
	dim plug_theme,plug_theme_call
	plug_theme="module/plug_spider/list.html"
	plug_theme_call="module/plug_spider/call.html"
	
	'注释：删除
	sub deldb()
		dim id:id=sdcms.getint(sdcms.fget("id",0),0)
		sdcms.db.dbdel "sd_plug_spider","id="&id
		sdcms.echo "1"
	end sub
	
	'注释：批量删除
	sub delsome()
		dim id:id=sdcms.enhtml(sdcms.fget("id",0))
		dim idarr:idarr=split(id,",")
		dim data
		if ubound(idarr)<0 then
			sdcms.echo "0&#33267;&#23569;&#36873;&#25321;&#19968;&#26465;&#20449;&#24687;"
		else
			dim i
			for i=0 to ubound(idarr)
				if not isnumeric(idarr(i)) then
					sdcms.echo "0&#21442;&#25968;&#65306;"&id(i)&"&#19981;&#27491;&#30830;&#65292;&#35831;&#30830;&#35748;&#21518;&#20877;&#25805;&#20316;"
					exit sub
				else
					sdcms.db.dbdel "sd_plug_spider","id="&idarr(i)
				end if
			next
			sdcms.echo "1"
		end if
	end sub
	
	'注释：清空
	sub clearall()
		sdcms.db.dbdel "sd_plug_spider",""
		sdcms.echo "1"
	end sub
	
	dim act:act=lcase(sdcms.fget("act",0))
	select case act
		case "del":deldb
		case "delsome":delsome
		case "clearall":clearall
		case "call":load plug_theme_call
		case else:load plug_theme
	end select
	sdcms.db.dbclose
%>